home *** CD-ROM | disk | FTP | other *** search
/ Apple II Magazines (PO) / Nibble Volume 10, No. 01 (1989-01)(MicroSPARC)(Side A)[a].zip / Nibble Volume 10, No. 01 (1989-01)(MicroSPARC)(Side A)[a].po / SLIDE.OBJ.S < prev    next >
Text File  |  1996-12-24  |  2KB  |  85 lines

  1. *                                                    *
  2. * SLIDE.OBJ Source Code
  3. * BY STEVE ELLIS
  4. * COPYRIGHT (C) 1989
  5. * MICROSPARC, INC.
  6. * CONCORD, MA 01742
  7. *
  8.  
  9.           XC             ;turn on 65816 opcodes
  10.           XC
  11.           ORG $0300
  12. TOOL      EQU $00E10000
  13.  
  14. *
  15. * Macro to put the 65816 in native mode, 16 bit acc. & regs.
  16. *
  17. NATIVE    MAC
  18.           CLC
  19.           XCE
  20.           REP #$30
  21.           <<<
  22. *
  23. * Macro to return to emulation mode
  24. *
  25. EMULATE   MAC
  26.           SEC
  27.           XCE
  28.           <<<
  29. *
  30. * Start up Quickdraw II.  Use $4000-$4300 as the 3 pages
  31. * of direct space it needs.
  32. *
  33. STARTUP   NATIVE
  34.           PEA $4000      ;change this if $4000-$4300 is needed
  35.                          ; for something else
  36.           PEA $0000      ;master SCB of 0 (320 mode, palette 0)
  37.           PEA $0000      ;size of largest pixel map, 0 = screen width
  38.           PEA $1000      ;arbitrary ID number, since we should be
  39.                          ; the only application running that requires
  40.                          ; an ID
  41.           LDX #$0204     ;QDStartUp
  42.           JSL TOOL
  43.           EMULATE
  44.           RTS
  45. *
  46. * Calculate the width of the string ending with 0 that has been
  47. * put in memory at $2E0.
  48. *
  49. CALCWID   NATIVE
  50.           PHA            ;space for result
  51.           PEA $0000
  52.           PEA $02E0      ;pointer to C string
  53.           LDX #$AA04     ;CStringWidth
  54.           JSL TOOL
  55.           PLA
  56.           STA WIDTH      ;put the width where Applesoft can get it
  57.           EMULATE
  58.           RTS
  59. *
  60. * Position the pen at the bottom of the screen and draw the
  61. * picture title.
  62. *
  63. DRAWSTR   NATIVE
  64.           PEA $0000      ;horizontal pos., changed by calling program
  65.           PEA $00C7      ;vertical pos., bottom of screen
  66.           LDX #$3A04     ;MoveTo
  67.           JSL TOOL
  68.           PEA $0000
  69.           PEA $02E0      ;pointer to C string
  70.           LDX #$A604     ;DrawCString
  71.           JSL TOOL
  72.           EMULATE
  73.           RTS
  74. *
  75. * Shut down Quickdraw and release the direct page space used.
  76. * Be SURE to CALL this routine if you accidentally press RESET,
  77. * or the program won't be able to restart Quickdraw correctly.
  78. *
  79. SHUTDOWN  NATIVE
  80.           LDX #$0304     ;QDShutDown
  81.           JSL TOOL
  82.           EMULATE
  83.           RTS
  84. WIDTH     DS 1           ;width of picture title
  85.